<%@ page pageEncoding="UTF-8"%>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-nested" prefix="nested"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix='fmt'%>

<style>
	label {width: auto;}
	.opr {margin: 3px 2px;}
	.dispose {text-decoration: line-through; color: red;}
	ul.infoshow {padding:5px 0 0 5px; overflow:auto; width: 80%;}
	ul.infoshow li {line-height: 30px; float:left; margin-right: 15px;}
	.opdisabled {text-decoration: line-through; color: #DDD; line-height: 21px;}
	td.ongoing {background-color: #99FF99; color: #333;}
	td.finished {background-color: #ddd;}
</style>

<script>
	
	function after_switch(tab_index) {
		var current_panel = $.pdialog.getCurrent() && $.pdialog.getCurrent().filter(":visible").length > 0 ? $.pdialog.getCurrent() : navTab.getCurrentPanel();
		$("#currentindex", current_panel).val(tab_index);
		
		if (tab_index == 0) {
			$("#proj_progress", current_panel).css("display", "");
			$("#proj_status", current_panel).css("display", "");
		} else {
			$("#proj_progress", current_panel).css("display", "none");
			$("#proj_status", current_panel).css("display", "none");
			$("#proj_progress", current_panel).find("option[value='']").attr("selected", "selected");
			$("#proj_status", current_panel).find("option[value='']").attr("selected", "selected");
		}
		
	}
</script>

<form id="pagerForm" method="post" action="app/project/archive.do?action=pageProjectArchiveIndex">
	<input type="hidden" name="pageNum" value="${pageNum ne null ? pageNum : 1}" />
	<input type="hidden" name="numPerPage" value="${numPerPage ne null ? numPerPage : 20}" />
	<input type="hidden" id="currentindex" name="currentindex" value="${currentindex ne null ? currentindex : 0}" />
</form>

<!-- SearchBar -->
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="app/project/archive.do?action=pageProjectArchiveIndex" method="post" id="searchForm" rel="pagerForm">
		<div class="searchBar">
			<table class="searchContent" id="archive_form">
				<tr>
					<td>
						<label>项目编号：</label>
						<input type="text" name="projectNo" rel="pagerForm" value="${projectNo ne null ? projectNo : ''}" style="width: 120px;"/>
					</td>
					<td>
						<label>项目名称：</label>
						<input type="text" name="projectName" rel="pagerForm" value="${formEntity ne null ? formEntity.projectName : ''}" style="width: 120px;"/>
					</td>
					<td>
						<label>行业类别：</label>
						<select class="combox required" error_message="请选择`项目所属行业`" name="projectTypeId" id="proj_archive_type_${cat}" style="width: 120px;">
							<option value="">请选择一个行业</option>
							<logic:present name="dictInds">
								<logic:iterate name="dictInds" id="dict">
									<option value="${dict.id}" ${projectTypeId ne null && projectTypeId eq dict.id ? 'selected="true"' : ''}>${dict.dictKey}</option>
								</logic:iterate>
							</logic:present>
						</select>
					</td>
					<td>
						<label>项目负责人：</label>
						<input id="projectMgrId" name="mgr.id" value="${formEntity ne null && formEntity.projectManager ne null ? entity.projectManager.id : ''}" type="hidden"/>
						<input id="projectMgr" type="text" name="mgr.username" rel="pagerForm" value="${formEntity ne null && formEntity.projectManager ne null ? formEntity.projectManager.username : ''}" postField="search" suggestFields="username,userNo" suggestUrl="app/base.do?action=lookupUserByName" lookupGroup="mgr" style="width: 120px;"/>
					</td>
				</tr>
				<tr>
					<td id="proj_progress">
						<label>项目进展：</label>
						<select class="" name="condVO.condProjectProcess" style="width: 127px;">
							<option value="">所有</option>
							<option value="-1" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condProjectProcess eq '-1' ? 'selected' : ''}>项目分配</option>
							<logic:present name="processes">
								<logic:iterate name="processes" id="process">
									<option value="${process.nodeTitle}" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condProjectProcess eq process.nodeTitle ? 'selected' : ''}>${process.nodeTitle}</option>
								</logic:iterate>
							</logic:present>
						</select>
					</td>
					<td id="proj_status">
						<label>项目状态：</label>
						<select class="" name="condVO.condProjectStatus" style="width: 127px;">
							<option value="" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condProjectStatus eq '' ? 'selected' : ''}>所有</option>
							<option value="-9" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condProjectStatus eq '-9' ? 'selected' : ''}>待分配</option>
							<option value="0" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condProjectStatus eq '0' ? 'selected' : ''}>材料待提交</option>
							<option value="1" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condProjectStatus eq '1' ? 'selected' : ''}>审批中</option>
							<option value="-1" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condProjectStatus eq '-1' ? 'selected' : ''}>审批退回</option>
						</select>
					</td>
					<c:if test="${cat ne null && cat eq 'my'}">
					<td>
						<label>参与类型：</label>
						<select class="" name="condVO.condParticipantType" style="width: 146px;">
							<option value="" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condParticipantType eq '' ? 'selected' : ''}>所有</option>
							<option value="1" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condParticipantType eq '1' ? 'selected' : ''}>负责项目</option>
							<option value="0" ${formEntity ne null && formEntity.condVO ne null && formEntity.condVO.condParticipantType eq '0' ? 'selected' : ''}>参与项目</option>
						</select>
					</td>
					</c:if>
					<input type="hidden" name="module" value="${module ne null ? module : ''}" />
					<input type="hidden" name="status" value="${status ne null ? status : ''}" />
					<input type="hidden" name="cat" value="${cat ne null ? cat : ''}" />
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
				</ul>
			</div>
		</div>
		<input type="hidden" name="currentindex" id="currentindex" value="${currentindex ne null ? currentindex : 0}" />
	</form>
</div>

<!-- Body -->
<div class="unitBox" id="jbsxBox">
	<div class="pageContent">
		
		<!-- Tabs -->
		<div class="tabs" currentindex="${currentindex ne null ? currentindex : 0}" eventtype="click">
			<div class="tabsHeader">
				<div class="tabsHeaderContent">
					<ul>
						<li class="selected"><a href="app/project/archive.do?action=actionLoadProjectArchivesByStatus&module=${module}&status=follow&cat=${cat}" class="j-ajax" callback="after_switch(0)" paramRef="pagerForm, archive_form"><span>跟进项目</span></a></li>
						<li><a href="app/project/archive.do?action=actionLoadProjectArchivesByStatus&module=${module}&status=approved&cat=${cat}" class="j-ajax" callback="after_switch(1)" paramRef="pagerForm, archive_form"><span>立项项目</span></a></li>
						<li><a href="app/project/archive.do?action=actionLoadProjectArchivesByStatus&module=${module}&status=archived&cat=${cat}" class="j-ajax" callback="after_switch(2)" paramRef="pagerForm, archive_form"><span>储备项目</span></a></li>
						<li><a href="app/project/archive.do?action=actionLoadProjectArchivesByStatus&module=${module}&status=rejected&cat=${cat}" class="j-ajax" callback="after_switch(3)" paramRef="pagerForm, archive_form"><span>否决项目</span></a></li>
					</ul>
				</div>
			</div>
			<div class="tabsContent" style="height:auto;">
				<div inited="1000" style="display: none;"></div>
				<div inited="1000" style="display: block;"></div>
				<div inited="1000" style="display: block;"></div>
				<div inited="1000" style="display: block;"></div>
			</div>
			<div class="tabsFooter">
				<div class="tabsFooterContent"></div>
			</div>
		</div>
	</div>
</div>